import Vue from 'vue'
import VueRouter from 'vue-router'


import waimai from './../pages/waimai/waimai.vue'
import chuxing from './../pages/Chuxing/Chuxing.vue'
import wanggou from './../pages/wanggou/wanggou.vue'
import kuaican from './../pages/kuaican/kuaican.vue'
import yule from './../pages/yule/yule.vue'

import all from './../pages/waimai/children/all.vue'
import eleme from './../pages/waimai/children/eleme'
import mtwaimai from './../pages/waimai/children/mtwaimai'
import nuomi from './../pages/waimai/children/nuomi'
import dazhong from './../pages/waimai/children/dazhong'

Vue.use(VueRouter);

export default new VueRouter({
    routes: [{
            path: '/',
            component: waimai
        },
        {
            path: '/waimai',
            component: waimai,
            children: [{
                    path: "all",
                    component: all
                },
                {
                    path: "eleme",
                    component: eleme
                },
                {
                    path: "mtwaimai",
                    component: mtwaimai
                },
                {
                    path: "dazhong",
                    component: dazhong
                },
                {
                    path: "nuomi",
                    component: nuomi
                }
            ]
        },
        {
            path: '/chuxing',
            component: chuxing
        },
        {
            path: '/wanggou',
            component: wanggou
        },
        {
            path: '/kuaican',
            component: kuaican
        },
        {
            path: '/yule',
            component: yule
        },
        {
            path: '/',
            redirect: '/waimai'
        }
    ]

})